package com.example.hcbmsm.util;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Xinghm
 * @version 1.0
 * @since 2024/9/3 16:04
 */
public class HCBMSMResult {
    public static Map SUCCESS(){
        Map map = new HashMap<>();
        map.put("code",200);
        map.put("msg","success");
        return map;
    }

    public static Map SUCCESS(Object object){
        Map map = new HashMap<>();
        map.put("code",200);
        map.put("msg","success");
        map.put("data",object);
        return map;
    }

    public static Map SUCCESS(List list){
        Map map = new HashMap<>();
        map.put("code",200);
        map.put("msg","success");
        map.put("data",list);
        return map;
    }

    public static Map SUCCESS(Map map1){
        Map map = new HashMap<>();
        map.put("code",200);
        map.put("msg","success");
        map.put("data",map1);
        return map;
    }

    public static Map WARNING(int code) {
        Map map = new HashMap<>();
        map.put("code",code);
        map.put("msg","warning");
        return map;
    }

    public static Map WARNING(int code, String msg) {
        Map map = new HashMap<>();
        map.put("code",code);
        map.put("msg",msg);
        return map;
    }

    public static Map ERROR() {
        Map map = new HashMap<>();
        map.put("code",400);
        map.put("msg","error");
        return map;
    }

    public static Map ERROR(String msg) {
        Map map = new HashMap<>();
        map.put("code",400);
        map.put("msg",msg);
        return map;
    }
}
